<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<div id="userContainer" class="page-box">
	<el-row class="qry-box">
	   <el-form :inline="true" :model="userQryForm" onsubmit="return false">
	      <el-form-item>
	          <el-button type="text" icon="plus" @click="openAddUserPage(1,$event)">新增</el-button>
	      </el-form-item>
		  <el-form-item label="用户名：">
		    <el-input v-model="userQryForm.userName" placeholder="请输入用户名、用户别名"></el-input>
		  </el-form-item>
		  <el-form-item>
		    <el-button type="primary" icon="search" @click="qryUser" :loading="loading">查询</el-button>
		  </el-form-item>
		</el-form>
	</el-row>
	<el-row class="table-box">
	  <el-table :data="tableUsers" border="true" stripe="true" style="width: 100%" :height="tableHeight"  :loading="loading" :element-loading-text="loadingTxt">
	    <el-table-column prop="userName" label="用户名" width="100"></el-table-column>
	    <el-table-column prop="aliasName" label="显示别名" width="100"></el-table-column>
	    <el-table-column label="性别" width="80">
	      <template scope="scope">
	        <span>{{ sexName(scope.row.sex) }}</span>
	      </template>
	    </el-table-column>
	    <el-table-column prop="usableName" label="启用状态" width="100"></el-table-column>
	    <el-table-column prop="phone" label="联系电话" width="130"></el-table-column>
<!-- 	    <el-table-column prop="qq" label="QQ" min-width="100"></el-table-column> -->
	    <el-table-column prop="email" label="邮箱"min-width="120"></el-table-column>
	    <el-table-column label="操作" min-width="280" >
	        <template scope="scope">
		        <el-button type="primary" icon="edit" size="small" @click="openAddUserPage(2,$event)" :userId="scope.row.id">修改</el-button>
		        <el-button type="info" icon="view" size="small" @click="openAddUserPage(3,$event)" :userId="scope.row.id">详情</el-button>
		        <el-button type="success" icon="setting" size="small" :userId="scope.row.id" @click="openUserRoleWin">关联角色</el-button>
		        <el-button type="warning" icon="delete" size="small" @click="delUser"  :userId="scope.row.id" :userName="scope.row.userName">删除</el-button>
<!-- 		        <el-button type="warning" icon="view" size="small" @click="updatePwd($event)" :userId="scope.row.id">重置密码</el-button> -->
	        </template>
	    </el-table-column>
	  </el-table>
	</el-row>
	<el-row class="pagination-box">
		<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
	      :current-page="userCurrentPage"
	      :page-sizes="[defaultPageSize, 15, 20, 30]"
	      :page-size="userPageSize"
	      layout="total, sizes, prev, pager, next, jumper"
	      :total="userTotalCount">
	    </el-pagination>
	</el-row>
    <jsp:include page="addUser.jsp"></jsp:include>
    <jsp:include page="addUserRole.jsp"></jsp:include>
</div>
<script type="text/javascript" src="${ctx }/static/sys/admin/user/userManager.js"></script>
